<?php

use yii\db\Migration;

/**
 * Handles the creation of table `project_pre_evaluation_seal`.
 */
class m171027_074758_create_project_pre_evaluation_seal_table extends Migration
{
    /**
     * @inheritdoc
     * (抵押类项目预评估)抵押查封
     */
    public function up()
    {
        $this->createTable('project_pre_evaluation_seal', [
            'id' => $this->bigPrimaryKey(),
            'mortgage_id' => $this->bigInteger()->notNull(),
            'mortgage_type' => $this->string()->notNull()->comment('抵押物类型'),
            'mortgage_address' => $this->string()->comment('抵押物地址'),
            'mortgage_district' => $this->string()->comment('所在区域'),
            'mortgage_building_area' => $this->string()->comment('建筑面积（平米）'),
            'mortgage_land_area' => $this->string()->comment('土地面积（平米）'),
            'mortgage_owner' => $this->string()->comment('权属人'),
            'is_first_mortgage' => $this->smallInteger()->comment('是否首押'),//1是2否
            'mortgage_future' => $this->text()->comment('后续抵押情况'),
            'mortgage_state' => $this->text()->comment('抵/质押物情况'),
            'mortgage_seal_order' => $this->text()->comment('抵押物查封顺序'),
            'is_first_seal' => $this->smallInteger()->comment('是否首封'),//1是2否
            'mortgage_seal_state' => $this->text()->comment('抵押物查封情况'),
            'mortgage_other_seal_order' => $this->text()->comment('非抵押物查封顺序'),
            'mortgage_other_seal_state' => $this->text()->comment('非抵押物查封情况'),
            'mortgage_code' => $this->string()->comment('抵押物编号'),
            'whether_exploration' => $this->smallInteger()->comment('是否详勘'),//1是2否
            'other_warrants_code' => $this->string()->comment('他项权证号'),
            'created_at' => $this->timestamp(),
            'lock_user' => $this->integer()->comment('上锁用户'),
            'lock_timestamp' => $this->string()->comment('上锁时间'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('project_pre_evaluation_seal');
    }
}
